package com.he.hsdyc.controller;

import com.he.hsdyc.config.oss.OssClientUtils;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@Api(value="OssController",description="oss上传文件测试",tags={"oss上传文件测试"})
@RestController
@RequestMapping("oss")
public class OssController {

    @Autowired
    private OssClientUtils ossClientUtils;

    @RequestMapping(value = "uploadPic",method = RequestMethod.POST)
    public String uploadOss(HttpServletRequest request,String path) {
        return ossClientUtils.uploadImage(request, path);
    }
}
